/*
 Navicat Premium Dump SQL

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50725 (5.7.25)
 Source Host           : localhost:3306
 Source Schema         : test_rust

 Target Server Type    : MySQL
 Target Server Version : 50725 (5.7.25)
 File Encoding         : 65001

 Date: 18/05/2025 23:32:25
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for _sqlx_migrations
-- ----------------------------
DROP TABLE IF EXISTS `_sqlx_migrations`;
CREATE TABLE `_sqlx_migrations` (
  `version` bigint(20) NOT NULL,
  `description` text NOT NULL,
  `installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `success` tinyint(1) NOT NULL,
  `checksum` blob NOT NULL,
  `execution_time` bigint(20) NOT NULL,
  PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of _sqlx_migrations
-- ----------------------------
BEGIN;
INSERT INTO `_sqlx_migrations` (`version`, `description`, `installed_on`, `success`, `checksum`, `execution_time`) VALUES (20231001143156, 'users', '2025-05-17 11:24:40', 1, 0x939DBEE85EA0BE4DA16B8C759D1FE651C76C940C62A3FE1F6864A68828A875AD64FB3A3E29702B7CD82BD8D6F530DF92, 11548210);
INSERT INTO `_sqlx_migrations` (`version`, `description`, `installed_on`, `success`, `checksum`, `execution_time`) VALUES (20240505120000, 'rbac tables', '2025-05-17 11:24:40', 1, 0x1D9FD8958B183019573CAA9908E80B81827BF0A37A7D52EE15878F0C0A631C810F5C6683F117CCF3732400FE67515FAE, 122349624);
INSERT INTO `_sqlx_migrations` (`version`, `description`, `installed_on`, `success`, `checksum`, `execution_time`) VALUES (20240505120001, 'department tables', '2025-05-17 11:24:40', 1, 0x6C26E1F1A66EBDFDE59C515A3EA9C496F6AE090E78E116C1EF16B1E74D4173F07075BF3C8F9F01DCCCB5140279208579, 11670088);
INSERT INTO `_sqlx_migrations` (`version`, `description`, `installed_on`, `success`, `checksum`, `execution_time`) VALUES (20240511000000, 'init menu table', '2025-05-17 11:24:40', 1, 0x704AC999431C6E9727171DE5E4083E7843866F958BDD34E0624F159854D9570E50BBC2E6E0D8E5710F9823F4202813B8, 817662);
INSERT INTO `_sqlx_migrations` (`version`, `description`, `installed_on`, `success`, `checksum`, `execution_time`) VALUES (20240515143000, 'init menu data', '2025-05-17 11:24:40', 1, 0x1CA094426D180C2880F784469C56C2BE8E0A357A0D927E75CA9216EE111BA005C73F920793708ED068D113098CCF68CE, 3679764);
INSERT INTO `_sqlx_migrations` (`version`, `description`, `installed_on`, `success`, `checksum`, `execution_time`) VALUES (20240515150001, 'init rbac data', '2025-05-17 11:24:40', 0, 0xAB8DF001440FEEE232A3A824B2CB394749A1A625335339B5589A769594BB0AF43768DE28DB31C42F3BE8A8ABC74FAC7D, -1);
COMMIT;

-- ----------------------------
-- Table structure for departments
-- ----------------------------
DROP TABLE IF EXISTS `departments`;
CREATE TABLE `departments` (
  `department_id` varchar(36) NOT NULL COMMENT '部门ID',
  `parent_id` varchar(36) DEFAULT NULL COMMENT '父部门ID',
  `name` varchar(50) NOT NULL COMMENT '部门名称',
  `order_num` int(4) NOT NULL DEFAULT '0' COMMENT '显示顺序',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '部门状态(1正常 0停用)',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `create_by` varchar(100) DEFAULT NULL,
  `update_by` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='部门表';

-- ----------------------------
-- Records of departments
-- ----------------------------
BEGIN;
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000001', NULL, '总公司', 1, 1, '2025-05-17 03:24:40', '2025-05-17 14:57:11', '总部', 1, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000101', '1', '技术部', 1, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '技术研发中心', 2, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000102', '1', '市场部', 2, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '市场运营中心', 3, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000103', '1', '人事部', 3, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '人力资源中心', 4, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000201', '1', '前端开发组', 1, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '前端开发团队', 5, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000202', '1', '后端开发组', 2, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '后端开发团队', 6, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000203', '1', '测试组', 3, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '质量保障团队', 7, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000301', '2', '市场策划组', 1, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '市场策划团队', 8, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000302', '2', '品牌推广组', 2, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '品牌推广团队', 9, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000401', '3', '招聘组', 1, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '人才招聘团队', 10, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('10000000-0000-0000-0000-000000000402', '3', '培训组', 2, 1, '2025-05-17 03:24:40', '2025-05-18 16:08:36', '员工培训团队', 11, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('dep001', NULL, '总部', 1, 1, '2025-05-17 13:38:12', '2025-05-17 14:57:11', NULL, 12, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('dep002', '12', '技术部', 2, 1, '2025-05-17 13:38:12', '2025-05-18 16:08:36', NULL, 13, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('dep003', '12', '市场部', 3, 1, '2025-05-17 13:38:12', '2025-05-18 16:08:36', NULL, 14, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('dep004', '13', '研发中心', 1, 1, '2025-05-17 13:38:12', '2025-05-18 16:08:36', NULL, 15, NULL, NULL);
INSERT INTO `departments` (`department_id`, `parent_id`, `name`, `order_num`, `status`, `create_time`, `update_time`, `remark`, `id`, `create_by`, `update_by`) VALUES ('dep005', '13', '测试部', 2, 1, '2025-05-17 13:38:12', '2025-05-18 16:08:36', NULL, 16, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for menus
-- ----------------------------
DROP TABLE IF EXISTS `menus`;
CREATE TABLE `menus` (
  `id` varchar(36) NOT NULL COMMENT '菜单ID',
  `path` varchar(255) NOT NULL COMMENT '路由路径',
  `component` varchar(255) DEFAULT NULL COMMENT '组件路径',
  `redirect` varchar(255) DEFAULT NULL COMMENT '重定向路径',
  `name` varchar(255) DEFAULT NULL COMMENT '路由名称',
  `always_show` tinyint(1) DEFAULT '0' COMMENT '是否总是显示',
  `hidden` tinyint(1) DEFAULT '0' COMMENT '是否隐藏',
  `meta` json NOT NULL COMMENT '路由元数据',
  `parent_id` varchar(36) DEFAULT NULL COMMENT '父菜单ID',
  `order_num` int(11) DEFAULT '0' COMMENT '显示顺序',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `menu_type` int(11) DEFAULT '1' COMMENT '1=菜单,2=按钮',
  `permission_code` varchar(100) DEFAULT NULL COMMENT '权限标识符如user:add',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='菜单表';

-- ----------------------------
-- Records of menus
-- ----------------------------
BEGIN;
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('1001', '/permission', 'layout/Layout', '/permission/index', 'Permission', 1, 0, '{\"icon\": \"lock\", \"title\": \"Permission\", \"noCache\": false}', NULL, 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('1002', 'page', 'views/permission/page', NULL, 'Page Permission', 0, 0, '{\"title\": \"Page Permission\"}', '1001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('1003', 'directive', 'views/permission/directive', NULL, 'Directive Permission', 0, 0, '{\"title\": \"Directive Permission\"}', '1001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('1004', 'role', 'views/permission/role', NULL, 'Role Permission', 0, 0, '{\"title\": \"Role Permission\"}', '1001', 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('2001', '/icon', 'layout/Layout', NULL, 'Icons', 0, 0, '{\"icon\": \"icon\", \"title\": \"Icons\", \"noCache\": true}', NULL, 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('2002', 'index', 'views/icons/index', NULL, 'Icons', 0, 0, '{\"icon\": \"icon\", \"title\": \"Icons\", \"noCache\": true}', '2001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3001', '/components', 'layout/Layout', 'noRedirect', 'Components', 0, 0, '{\"icon\": \"component\", \"title\": \"Components\", \"noCache\": false}', NULL, 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3002', 'tinymce', 'views/components-demo/tinymce', NULL, 'Tinymce', 0, 0, '{\"title\": \"Tinymce\"}', '3001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3003', 'markdown', 'views/components-demo/markdown', NULL, 'Markdown', 0, 0, '{\"title\": \"Markdown\"}', '3001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3004', 'json-editor', 'views/components-demo/json-editor', NULL, 'Json Editor', 0, 0, '{\"title\": \"Json Editor\"}', '3001', 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3005', 'split-pane', 'views/components-demo/split-pane', NULL, 'SplitPane', 0, 0, '{\"title\": \"SplitPane\"}', '3001', 4, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3006', 'avatar-upload', 'views/components-demo/avatar-upload', NULL, 'Avatar Upload', 0, 0, '{\"title\": \"Avatar Upload\"}', '3001', 5, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3007', 'dropzone', 'views/components-demo/dropzone', NULL, 'Dropzone', 0, 0, '{\"title\": \"Dropzone\"}', '3001', 6, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3008', 'sticky', 'views/components-demo/sticky', NULL, 'Sticky', 0, 0, '{\"title\": \"Sticky\"}', '3001', 7, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3009', 'count-to', 'views/components-demo/count-to', NULL, 'Count To', 0, 0, '{\"title\": \"Count To\"}', '3001', 8, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3010', 'mixin', 'views/components-demo/mixin', NULL, 'Component Mixin', 0, 0, '{\"title\": \"componentMixin\"}', '3001', 9, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3011', 'back-to-top', 'views/components-demo/back-to-top', NULL, 'Back To Top', 0, 0, '{\"title\": \"Back To Top\"}', '3001', 10, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3012', 'drag-dialog', 'views/components-demo/drag-dialog', NULL, 'Drag Dialog', 0, 0, '{\"title\": \"Drag Dialog\"}', '3001', 11, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3013', 'drag-select', 'views/components-demo/drag-select', NULL, 'Drag Select', 0, 0, '{\"title\": \"Drag Select\"}', '3001', 12, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3014', 'dnd-list', 'views/components-demo/dnd-list', NULL, 'Dnd List', 0, 0, '{\"title\": \"Dnd List\"}', '3001', 13, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('3015', 'drag-kanban', 'views/components-demo/drag-kanban', NULL, 'Drag Kanban', 0, 0, '{\"title\": \"Drag Kanban\"}', '3001', 14, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('4001', '/charts', 'layout/Layout', 'noRedirect', 'Charts', 0, 0, '{\"icon\": \"chart\", \"title\": \"Charts\", \"noCache\": false}', NULL, 4, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('4002', 'keyboard', 'views/charts/keyboard', NULL, 'Keyboard Chart', 0, 0, '{\"title\": \"Keyboard Chart\", \"noCache\": true}', '4001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('4003', 'line', 'views/charts/line', NULL, 'Line Chart', 0, 0, '{\"title\": \"Line Chart\", \"noCache\": true}', '4001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('4004', 'mixchart', 'views/charts/mixChart', NULL, 'Mix Chart', 0, 0, '{\"title\": \"Mix Chart\", \"noCache\": true}', '4001', 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5001', '/nested', 'layout/Layout', '/nested/menu1/menu1-1', 'Nested', 0, 0, '{\"icon\": \"nested\", \"title\": \"Nested\", \"noCache\": false}', NULL, 5, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5002', 'menu1', 'views/nested/menu1/index', '/nested/menu1/menu1-1', 'Menu1', 0, 0, '{\"title\": \"Menu1\"}', '5001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5003', 'menu1-1', 'views/nested/menu1/menu1-1', NULL, 'Menu1-1', 0, 0, '{\"title\": \"Menu1-1\"}', '5002', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5004', 'menu1-2', 'views/nested/menu1/menu1-2', '/nested/menu1/menu1-2/menu1-2-1', 'Menu1-2', 0, 0, '{\"title\": \"Menu1-2\"}', '5002', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5005', 'menu1-2-1', 'views/nested/menu1/menu1-2/menu1-2-1', NULL, 'Menu1-2-1', 0, 0, '{\"title\": \"Menu1-2-1\"}', '5004', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5006', 'menu1-2-2', 'views/nested/menu1/menu1-2/menu1-2-2', NULL, 'Menu1-2-2', 0, 0, '{\"title\": \"Menu1-2-2\"}', '5004', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5007', 'menu1-3', 'views/nested/menu1/menu1-3', NULL, 'Menu1-3', 0, 0, '{\"title\": \"Menu1-3\"}', '5002', 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('5008', 'menu2', 'views/nested/menu2/index', NULL, 'Menu2', 0, 0, '{\"title\": \"Menu2\"}', '5001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('6001', '/example', 'layout/Layout', '/example/list', 'Example', 0, 0, '{\"icon\": \"example\", \"title\": \"Example\", \"noCache\": false}', NULL, 6, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('6002', 'create', 'views/example/create', NULL, 'Create Article', 0, 0, '{\"icon\": \"edit\", \"title\": \"Create Article\"}', '6001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('6003', 'edit/:id(\\d+)', 'views/example/edit', NULL, 'Edit Article', 0, 1, '{\"title\": \"Edit Article\", \"noCache\": true}', '6001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('6004', 'list', 'views/example/list', NULL, 'Article List', 0, 0, '{\"icon\": \"list\", \"title\": \"Article List\"}', '6001', 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('7001', '/tab', 'layout/Layout', NULL, 'Tab', 0, 0, '{\"icon\": \"tab\", \"title\": \"Tab\", \"noCache\": false}', NULL, 7, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('7002', 'index', 'views/tab/index', NULL, 'Tab', 0, 0, '{\"icon\": \"tab\", \"title\": \"Tab\"}', '7001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('8001', '/error', 'layout/Layout', 'noRedirect', 'Error Pages', 0, 0, '{\"icon\": \"404\", \"title\": \"Error Pages\", \"noCache\": false}', NULL, 8, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('8002', '401', 'views/error-page/401', NULL, 'Page 401', 0, 0, '{\"title\": \"Page 401\", \"noCache\": true}', '8001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('8003', '404', 'views/error-page/404', NULL, 'Page 404', 0, 0, '{\"title\": \"Page 404\", \"noCache\": true}', '8001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('9001', '/error-log', 'layout/Layout', 'noRedirect', 'Error Log', 0, 0, '{\"icon\": \"bug\", \"title\": \"Error Log\", \"noCache\": false}', NULL, 9, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('9002', 'log', 'views/error-log/index', NULL, 'Error Log', 0, 0, '{\"icon\": \"bug\", \"title\": \"Error Log\"}', '9001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('a001', '/excel', 'layout/Layout', '/excel/export-excel', 'Excel', 0, 0, '{\"icon\": \"excel\", \"title\": \"Excel\", \"noCache\": false}', NULL, 10, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('a002', 'export-excel', 'views/excel/export-excel', NULL, 'Export Excel', 0, 0, '{\"title\": \"Export Excel\"}', 'a001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('a003', 'export-selected-excel', 'views/excel/select-excel', NULL, 'Select Excel', 0, 0, '{\"title\": \"Select Excel\"}', 'a001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('a004', 'export-merge-header', 'views/excel/merge-header', NULL, 'Merge Header', 0, 0, '{\"title\": \"Merge Header\"}', 'a001', 3, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('a005', 'upload-excel', 'views/excel/upload-excel', NULL, 'Upload Excel', 0, 0, '{\"title\": \"Upload Excel\"}', 'a001', 4, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('b001', '/zip', 'layout/Layout', '/zip/download', 'Zip', 1, 0, '{\"icon\": \"zip\", \"title\": \"Zip\", \"noCache\": false}', NULL, 11, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('b002', 'download', 'views/zip/index', NULL, 'Export Zip', 0, 0, '{\"title\": \"Export Zip\"}', 'b001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('c001', '/pdf', 'layout/Layout', '/pdf/index', 'PDF', 0, 0, '{\"icon\": \"pdf\", \"title\": \"PDF\", \"noCache\": false}', NULL, 12, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('c002', 'index', 'views/pdf/index', NULL, 'PDF', 0, 0, '{\"icon\": \"pdf\", \"title\": \"PDF\"}', 'c001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('c003', 'download', 'views/pdf/download', NULL, 'PDF Download', 0, 1, '{\"title\": \"PDF Download\"}', 'c001', 2, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('d001', '/theme', 'layout/Layout', 'noRedirect', 'Theme', 0, 0, '{\"icon\": \"theme\", \"title\": \"Theme\", \"noCache\": false}', NULL, 13, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('d002', 'index', 'views/theme/index', NULL, 'Theme', 0, 0, '{\"icon\": \"theme\", \"title\": \"Theme\"}', 'd001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('e001', '/clipboard', 'layout/Layout', 'noRedirect', 'Clipboard', 0, 0, '{\"icon\": \"clipboard\", \"title\": \"Clipboard Demo\", \"noCache\": false}', NULL, 14, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('e002', 'index', 'views/clipboard/index', NULL, 'Clipboard', 0, 0, '{\"icon\": \"clipboard\", \"title\": \"Clipboard Demo\"}', 'e001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('f001', '/i18n', 'layout/Layout', NULL, 'I18n', 0, 0, '{\"icon\": \"international\", \"title\": \"I18n\", \"noCache\": false}', NULL, 15, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('f002', 'index', 'views/i18n-demo/index', NULL, 'I18n', 0, 0, '{\"icon\": \"international\", \"title\": \"I18n\"}', 'f001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('g001', 'external-link', 'layout/Layout', NULL, 'External Link', 0, 0, '{\"icon\": \"link\", \"title\": \"External Link\", \"noCache\": false}', NULL, 16, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('g002', 'https://github.com/PanJiaChen/vue-element-admin', 'views/external-link', NULL, 'External Link', 0, 0, '{\"icon\": \"link\", \"title\": \"External Link\"}', 'g001', 1, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
INSERT INTO `menus` (`id`, `path`, `component`, `redirect`, `name`, `always_show`, `hidden`, `meta`, `parent_id`, `order_num`, `create_time`, `update_time`, `menu_type`, `permission_code`) VALUES ('h001', '*', 'views/error-page/404', '/404', '404', 0, 1, '{\"title\": \"404 Page\"}', NULL, 17, '2025-05-17 03:24:40', '2025-05-17 03:24:40', 1, NULL);
COMMIT;

-- ----------------------------
-- Table structure for role_menus
-- ----------------------------
DROP TABLE IF EXISTS `role_menus`;
CREATE TABLE `role_menus` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_id` varchar(36) NOT NULL COMMENT '角色ID',
  `menu_id` varchar(36) NOT NULL COMMENT '菜单ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_role_menu` (`role_id`,`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='角色和菜单关联表';

-- ----------------------------
-- Records of role_menus
-- ----------------------------
BEGIN;
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (1, 'role001', 'menu001', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (2, 'role001', 'menu002', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (3, 'role001', 'menu003', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (4, 'role001', 'menu004', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (5, 'role001', 'menu005', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (6, 'role001', 'menu006', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (7, 'role002', 'menu001', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (8, 'role002', 'menu002', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (9, 'role002', 'menu005', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (10, 'role002', 'menu006', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (11, 'role003', 'menu006', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (12, 'role004', 'menu001', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (13, 'role004', 'menu006', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (14, 'role005', 'menu001', '2025-05-17 14:38:08');
INSERT INTO `role_menus` (`id`, `role_id`, `menu_id`, `create_time`) VALUES (15, 'role005', 'menu006', '2025-05-17 14:38:08');
COMMIT;

-- ----------------------------
-- Table structure for roles
-- ----------------------------
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
  `id` varchar(36) NOT NULL COMMENT '角色ID',
  `name` varchar(50) NOT NULL COMMENT '角色名称',
  `description` varchar(255) DEFAULT NULL COMMENT '角色描述',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `code` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色信息表';

-- ----------------------------
-- Records of roles
-- ----------------------------
BEGIN;
INSERT INTO `roles` (`id`, `name`, `description`, `create_time`, `update_time`, `code`) VALUES ('role001', '一般用户', '基础权限的普通用户角色', '2025-05-18 16:34:23', '2025-05-18 16:36:11', 'COMMON');
INSERT INTO `roles` (`id`, `name`, `description`, `create_time`, `update_time`, `code`) VALUES ('role002', '管理员', '具备系统管理权限的角色', '2025-05-18 16:34:23', '2025-05-18 17:07:13', 'org_admin');
INSERT INTO `roles` (`id`, `name`, `description`, `create_time`, `update_time`, `code`) VALUES ('role003', '超级管理员', '拥有系统全部权限的最高级角色', '2025-05-18 16:34:23', '2025-05-18 17:07:13', 'admin');
COMMIT;

-- ----------------------------
-- Table structure for user_departments
-- ----------------------------
DROP TABLE IF EXISTS `user_departments`;
CREATE TABLE `user_departments` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` varchar(36) NOT NULL COMMENT '用户ID',
  `dept_id` varchar(36) NOT NULL COMMENT '部门ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user_dept` (`user_id`,`dept_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='用户和部门关联表';

-- ----------------------------
-- Records of user_departments
-- ----------------------------
BEGIN;
INSERT INTO `user_departments` (`id`, `user_id`, `dept_id`, `create_time`) VALUES (1, 'user001', 'dep001', '2025-05-17 14:37:00');
INSERT INTO `user_departments` (`id`, `user_id`, `dept_id`, `create_time`) VALUES (2, 'user002', 'dep002', '2025-05-17 14:37:00');
INSERT INTO `user_departments` (`id`, `user_id`, `dept_id`, `create_time`) VALUES (3, 'user003', 'dep003', '2025-05-17 14:37:00');
INSERT INTO `user_departments` (`id`, `user_id`, `dept_id`, `create_time`) VALUES (4, 'user004', 'dep004', '2025-05-17 14:37:00');
INSERT INTO `user_departments` (`id`, `user_id`, `dept_id`, `create_time`) VALUES (5, 'user005', 'dep005', '2025-05-17 14:37:00');
COMMIT;

-- ----------------------------
-- Table structure for user_roles
-- ----------------------------
DROP TABLE IF EXISTS `user_roles`;
CREATE TABLE `user_roles` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` varchar(36) NOT NULL COMMENT '用户ID',
  `role_id` varchar(36) NOT NULL COMMENT '角色ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `create_by` varchar(100) DEFAULT NULL,
  `update_by` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_user_role` (`user_id`,`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='用户和角色关联表';

-- ----------------------------
-- Records of user_roles
-- ----------------------------
BEGIN;
INSERT INTO `user_roles` (`id`, `user_id`, `role_id`, `create_time`, `update_time`, `create_by`, `update_by`) VALUES (1, 'user001', 'role003', '2025-05-17 14:32:57', '2025-05-18 16:39:43', NULL, NULL);
INSERT INTO `user_roles` (`id`, `user_id`, `role_id`, `create_time`, `update_time`, `create_by`, `update_by`) VALUES (2, 'user002', 'role002', '2025-05-17 14:32:57', '2025-05-17 14:32:57', NULL, NULL);
INSERT INTO `user_roles` (`id`, `user_id`, `role_id`, `create_time`, `update_time`, `create_by`, `update_by`) VALUES (3, 'user003', 'role003', '2025-05-17 14:32:57', '2025-05-17 14:32:57', NULL, NULL);
INSERT INTO `user_roles` (`id`, `user_id`, `role_id`, `create_time`, `update_time`, `create_by`, `update_by`) VALUES (4, 'user004', 'role001', '2025-05-17 14:32:57', '2025-05-18 16:36:56', NULL, NULL);
INSERT INTO `user_roles` (`id`, `user_id`, `role_id`, `create_time`, `update_time`, `create_by`, `update_by`) VALUES (5, 'user005', 'role001', '2025-05-17 14:32:57', '2025-05-18 16:36:56', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` varchar(36) NOT NULL COMMENT '用户ID',
  `username` varchar(50) NOT NULL COMMENT '登录账号',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `email` varchar(50) DEFAULT '' COMMENT '用户邮箱',
  `phone` varchar(11) DEFAULT '' COMMENT '手机号码',
  `status` char(1) DEFAULT '0' COMMENT '帐号状态（0正常 1锁定）',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `nickname` varchar(100) DEFAULT NULL,
  `create_by` varchar(100) DEFAULT NULL,
  `update_by` varchar(100) DEFAULT NULL,
  `introduction` varchar(500) DEFAULT NULL COMMENT '简介',
  `avatar` varchar(300) DEFAULT NULL COMMENT '头像路径',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表';

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `create_time`, `update_time`, `nickname`, `create_by`, `update_by`, `introduction`, `avatar`) VALUES ('user001', 'admin', '$argon2id$v=19$m=19456,t=2,p=1$9GmIn4pPBVRS+hs5Hu5yNg$Nx1YWoEgfDIg7fF6nCE5tMOkdQ7imHM/+bhqcYWOJag', '', '', '1', '2025-05-17 14:12:51', '2025-05-18 22:53:11', '超级管理员', NULL, NULL, '超级管理员', 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `create_time`, `update_time`, `nickname`, `create_by`, `update_by`, `introduction`, `avatar`) VALUES ('user002', 'manager', '$argon2id$v=19$m=19456,t=2,p=1$9GmIn4pPBVRS+hs5Hu5yNg$Nx1YWoEgfDIg7fF6nCE5tMOkdQ7imHM/+bhqcYWOJag', '', '', '1', '2025-05-17 14:12:51', '2025-05-18 14:42:04', '部门经理', NULL, NULL, NULL, NULL);
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `create_time`, `update_time`, `nickname`, `create_by`, `update_by`, `introduction`, `avatar`) VALUES ('user003', 'user', '$argon2id$v=19$m=19456,t=2,p=1$9GmIn4pPBVRS+hs5Hu5yNg$Nx1YWoEgfDIg7fF6nCE5tMOkdQ7imHM/+bhqcYWOJag', '', '', '1', '2025-05-17 14:12:51', '2025-05-18 14:42:04', '普通用户', NULL, NULL, NULL, NULL);
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `create_time`, `update_time`, `nickname`, `create_by`, `update_by`, `introduction`, `avatar`) VALUES ('user004', 'dev1', '$argon2id$v=19$m=19456,t=2,p=1$9GmIn4pPBVRS+hs5Hu5yNg$Nx1YWoEgfDIg7fF6nCE5tMOkdQ7imHM/+bhqcYWOJag', '', '', '1', '2025-05-17 14:12:51', '2025-05-18 14:42:04', '开发人员1', NULL, NULL, NULL, NULL);
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `create_time`, `update_time`, `nickname`, `create_by`, `update_by`, `introduction`, `avatar`) VALUES ('user005', 'tester1', '$argon2id$v=19$m=19456,t=2,p=1$9GmIn4pPBVRS+hs5Hu5yNg$Nx1YWoEgfDIg7fF6nCE5tMOkdQ7imHM/+bhqcYWOJag', '', '', '1', '2025-05-17 14:12:51', '2025-05-18 14:42:04', '测试人员1', NULL, NULL, NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
